package ru.ifmo.filemanager.ftpplugin;

import java.io.IOException;

import ru.ifmo.filemanager.filesystem.abstractplugin.AbstractDirectory;
import ru.ifmo.filemanager.filesystem.interfaces.FileSystemObject;

public class FtpChildDirectory  extends AbstractDirectory{
	
	private final String name;
	private final String pathTo;
	private final FtpTopDirectory root;
	

	public FtpChildDirectory(String name, String pathTo, FtpTopDirectory root) {
		super();
		this.name = name;
		this.pathTo = pathTo;
		this.root = root;
	}	

	@Override
	public String[] list() throws IOException {		
		return root.list(pathTo + '\\' + name);
	}

	@Override
	public FileSystemObject lookup(String name) throws IOException {
		
		// TODO Auto-generated method stub
		return null;
	}


	@Override
	public String getName() {
		return name;
	}

}
